package com.yunhe.inspect.service.impl;

import com.yunhe.inspect.domain.InspectProcess;
import com.yunhe.inspect.repository.InspectProcessRepository;
import com.yunhe.inspect.service.InspectProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: InspectProcessServiceImpl
 * @Description:
 * @author: GongDaCheng
 * @Date: 17:47 2021/11/11
 */
@Service
public class InspectProcessServiceImpl implements InspectProcessService {
    @Autowired
    private InspectProcessRepository inspectProcessRepository;


    @Override
    public int createInspectProcess (InspectProcess inspectProcess) {
        return inspectProcessRepository.createInspectProcessSelective(inspectProcess);
    }


    @Override
    public int deleteInspectProcess(int id) {
        return inspectProcessRepository.deleteInspectProcessByPrimaryKey(id);
    }


    @Override
    public int updateInspectProcess(InspectProcess inspectProcess) {
        return inspectProcessRepository.updateInspectProcessByPrimaryKeySelective(inspectProcess);
    }


    @Override
    public InspectProcess findInspectProcessById(int id) {
        return inspectProcessRepository.searchInspectProcessByPrimaryKey(id);
    }

    @Override
    public List<InspectProcess> getReviewProcessListByOrderId(Long inspectOrderId) {
        return inspectProcessRepository.getReviewProcessListByOrderId(inspectOrderId);
    }

    @Override
    public InspectProcess getListByRectificationId(Long rectificationId) {
        return inspectProcessRepository.getListByRectificationId(rectificationId);
    }
}
